The following is an example of a testing script that runs multiple tests in parallel,
using multiple instances of iperf servers. When you have installed iperf3 on a Linux
system, running the script can launch iperf server with multiple parallel instances,
where each instance has a unique port.
#!/bin/bash
# Run multiple parallel instances of iperf servers
# This example assumes the port numbers used by the servers start at 5001 and increase by one
# e.g. 5001, 5002, 5003, ...
# To specify a different base port, change the following parameter value
# to be: firstport - 1
base_port=$1
let base_port-- # Command line input: number of servers
# e.g. 5
num_servers=$2
shift # Command line input: base report file name
# e.g. report
report_base=$2
shift # Optional command line input: other iperf options
# e.g. -u
iperf_options="$*" # Run iperf multiple times
for i in `seq 1 $num_servers`; do # Set server port
server_port=$(($base_port+$i)); # Report file includes server port
report_file=${report_base}-${server_port}.txt
echo " report_file --> $report_file" # Run iperf
iperf3 3 3 -s -p $server_port -1 $iperf_options &> $report_file & done